package PTA.Mianxiangduixiang.ex23;

import java.util.Scanner;
class Goods{
    private String name;
    private double price;

    public Goods() {
    }

    public Goods(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String toString() {
        return  name+","+price;
    }
    public  double getPrice(){
double result=0;
result+=this.price;
return  result;
    }
}
public class ex23 {
    public static void main(String[] args) {
        Goods ga[] =new Goods[5];
        Scanner sc = new Scanner(System.in);

        for(int i =0;i<5;i++){
            ga[i]= new Goods(sc.next(),sc.nextDouble());
        }

        double  shouldPay = 0;
        for(Goods g:ga){
            shouldPay += g.getPrice();
            System.out.println(g.toString());
        }

        System.out.println("should pay:"+shouldPay);


    }
}
